<?php
namespace Org\Util;
use Think\Think;
class Sunline extends Think {

	public $token = '9f21c37a0b3fe8438b76ada908b68cdc';

	 public function api(){
     //   if (empty($params['module'])) return "";
        $params['token'] = $this->token;

        //这里可以加些验证规则，实现一些特殊目的。如安全方面的。
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'http://192.168.1.16/c6/JHOAService/JHService.asmx');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
        $output = curl_exec($ch);
        if ($output === FALSE) {
            return "API Error: " . curl_error($ch);
        }
        $info = curl_getinfo($ch);
        curl_close($ch);
        return array( 'result'=>$output,'info'=>$info);
    }

    public function isConnect(){
        return "_______OK!";
    }
}